package com.topscomm.main.config;

import com.topscomm.file.LocalRabbitProperties;
import com.topscomm.file.LocalRedisProperties;
import org.springframework.boot.autoconfigure.amqp.RabbitProperties;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.annotation.Order;

/**
 * com.topscomm.main.config
 * MengM_
 * 2022/7/1 16:06
 * filecenter
 */
@Configuration
public class LocalProperTiesConfig {

    @Bean
    @Order(0)
    @Primary
    @ConfigurationProperties(prefix = "spring.redis")
    public RedisProperties redisProperties() {
        return new LocalRedisProperties();
    }

    @Bean
    @Order(0)
    @Primary
    @ConfigurationProperties(prefix = "spring.rabbitmq")
    public RabbitProperties rabbitProperties() {
        return new LocalRabbitProperties();
    }
}
